<?php

class Notification_Controller_Browse_Ajax_Menu_Notification extends Nuo_Controller
{
	function execute($request)
	{
		$table = Nuo::getTable('notification');

		$viewer = Nuo::getUser();

		$select = $table -> select() -> order('created_at DESC') -> limit(10);

		$select -> where('receiver_id=?', $viewer -> getItemId());

		$paging = Nuo_Paging::factory($select);

		return  $this -> render(array(
			'paging' => $paging,
			'count' => $paging -> getItemCount()
		));
	}

}
